package com.yanqu.road.server.agent.inter;

import com.alibaba.fastjson.JSONObject;
import com.yanqu.road.entity.enums.eAgentErrorCode;
import com.yanqu.road.server.CrossBaseServer;
import com.yanqu.road.server.TempMgr;
import com.yanqu.road.server.agent.AgentInterfaceMgr;

public class AgentReload {

	public String reloadMgr(JSONObject param) {
		JSONObject ret = AgentInterfaceMgr.getDefaultRet();
		String content = param.getString("content");
		try {
			for (TempMgr mgr : CrossBaseServer.getInstance().getMgrList()) {
				if (mgr.getClass().getSimpleName().equals(content)) {
					mgr.reload();
				}
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}

		AgentInterfaceMgr.setCommonRet(ret, eAgentErrorCode.Success.getValue());
		return ret.toString();
	}
}
